package cn.Test1;

import java.util.Arrays;

/*本类用于复习String的案例*/
public class String123 {
    public static void main(String[] args) {
        String a ="abc";
        char[]b={'a','b','c'};

        System.out.println(b);

        System.out.println(a.hashCode());
        System.out.println(b.hashCode());

        System.out.println(Arrays.toString(b));

        System.out.println(a.equals(b));

        System.out.println(a.length());

        System.out.println(a.toUpperCase());
        System.out.println(a.toLowerCase());

        System.out.println(a.startsWith("a"));
        System.out.println(a.endsWith("b"));

        System.out.println(a.indexOf(0));
        System.out.println(a.lastIndexOf(3));

        String z = "QWYU";
        System.out.println(a.concat(z));

        String m = "  hhu  yuyu  ";
        System.out.println(m.trim());

        String w="absbdbfbgbhbjbk";
        String[]h=w.split("b");
        System.out.println(Arrays.toString(h));

        System.out.println(w.substring(2));
        System.out.println(w.substring(3,6));

        String s = "gdfsjfuhi";
        byte[]f = s.getBytes();
        System.out.println(Arrays.toString(f));

        System.out.println(s.charAt(5));
    }
}
